package com.sxbbc.seller.controller;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.function.common.GetRest;
import com.function.common.RestResponse;
import com.sxbbc.seller.common.MappingUtils;
import com.sxbbc.seller.service.StatisService;
import com.sxbbc.seller.util.BusinessSession;

/**
 * 商家统计controller
 * @author xiaoky
 * @date 2019-07-17
 */
@Controller
public class StatisController {
	@Autowired
	private HttpServletRequest request;
	@Autowired
	private StatisService statisService;
	
    /**
     * 商家首页订单饼图信息
     * @return
     * @author xiaoky
     */
    @RequestMapping(value = MappingUtils.QUERY_HOME_ORDER_MSG)
    @ResponseBody
    public RestResponse queryHomeOrderMsg () {
    	Integer bid = BusinessSession.getBid(request);
    	List<Map<String, Object>> list = statisService.queryHomeOrderMsg(bid);
    	return GetRest.getSuccess("", list);
    }
}
